package com.anywhere.freightman.system.dao;

import com.anywhere.freightman.common.BaseMapper;
import com.anywhere.freightman.system.model.UserModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserDao extends BaseMapper<UserModel> {

    @Select("select * from sso_user where mobile_phone=#{mobilePhone}")
    UserModel selectByMobilePhone(@Param("mobilePhone") String mobilePhone);

    @Select("select * from sso_user where username=#{username}")
    UserModel selectByUsername(@Param("username") String username);

    @Select("select * from sso_user where company_id=#{companyId}")
    List<UserModel> getListByCompanyId(@Param("companyId") Long companyId);


}
